<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');
?>
<p>
	<a href="index.php">&lt;&lt; Back to Subjects Portal</a><br />
</p>
<h1>Edit Subject</h1>

<?php

$subject_id = $_GET['id'];

//counting variable
$i = 0;

//select statement
$query="SELECT * FROM course_subjects WHERE id='$subject_id'";
$result=mysql_query($query);



$subject_name=mysql_result($result,$i,"subject_title");
$abbreviation=mysql_result($result,$i,"abbreviation");



echo "<form action='edit_do.php' method='post'>";

//start table
echo "<table border='0'>";
	
	//create table row
	echo "<tr>";
		echo "<td><b>Subject Name: </b></td>";
		echo "<td>";
		echo "<input type='text' name='name' value='$subject_name'>";
		echo "</td>";
	echo "</tr>";
	
	//create table row
	echo "<tr>";
		echo "<td><b>Abbreviation: </b></td>";
		echo "<td>";
		echo "<input type='text' name='abbrev' value='$abbreviation'>";
		echo "</td>";
	echo "</tr>";

//end table tag
echo "</table>";

echo "<input type='hidden' name='id' value='$subject_id'>";
echo "<p><input type='submit'></p>";
echo '</form>';


	

?>



<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>